package com.example.service.impl.institutioncare.jingfeibutie;

import com.example.bean.institutioncare.institutionadmin.Basicdata;
import com.example.bean.institutioncare.jingfeibutie.JingFeiBuTie;
import com.example.bean.institutioncare.jingfeibutie.JingFeiBuTieVo;
import com.example.mapper.institutioncare.jingfeibutie.JingFeiBuTieMapper;
import com.example.service.institutioncare.jingfeibutie.JingFeiBuTieService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JingFeiBuTieServiceImpl implements JingFeiBuTieService {

    @Autowired
    JingFeiBuTieMapper jingFeiBuTieMapper;

    @Override
    public PageInfo<JingFeiBuTie> jingfeifenye(JingFeiBuTieVo jingFeiBuTieVo) {
        PageHelper.startPage(jingFeiBuTieVo.getDqNum(),jingFeiBuTieVo.getXsNum());
        PageInfo page = new PageInfo<JingFeiBuTie>(jingFeiBuTieMapper.jingfeifenye(jingFeiBuTieVo));
        return page;
    }

    @Override
    public Integer tianjiajingfei(JingFeiBuTie jingFeiBuTie) {
        Double zongshu = jingFeiBuTie.getJianshebutie()+jingFeiBuTie.getYunyingbutie()+jingFeiBuTie.getSheshibutie()+jingFeiBuTie.getRenyuanbutie()+jingFeiBuTie.getQitabutie();
        jingFeiBuTie.setZongbutie(zongshu);
        return jingFeiBuTieMapper.tianjiajingfei(jingFeiBuTie);
    }

    @Override
    public JingFeiBuTie jingfeihuixian(String noid) {
        return jingFeiBuTieMapper.jingfeihuixian(noid);
    }

    @Override
    public Integer xiugaijingfei(JingFeiBuTie jingFeiBuTie) {
        Double zongshu = jingFeiBuTie.getJianshebutie()+jingFeiBuTie.getYunyingbutie()+jingFeiBuTie.getSheshibutie()+jingFeiBuTie.getRenyuanbutie()+jingFeiBuTie.getQitabutie();
        jingFeiBuTie.setZongbutie(zongshu);
        return jingFeiBuTieMapper.xiugaijingfei(jingFeiBuTie);
    }

    @Override
    public Integer jingfeishanchu(List<String> ids) {
        return jingFeiBuTieMapper.jingfeishanchu(ids);
    }

    @Override
    public List<Basicdata> jibenbiao() {
        return jingFeiBuTieMapper.jibenbiao();
    }

}
